High performance load balancing of outbound internet protocol traffic over multiple network interface cards

ABSTRACT

A method for selecting a network interface card (NIC) to be used to send an outgoing data packet from a server computer system having a plurality of NICs coupled thereto. The outgoing data packet is addressed using an Internet Protocol (IP) address and a Transmission Control Protocol (TCP) port number. A load balancing scheme is executed in order to select a NIC from the plurality of NICs. In one embodiment, the load balancing scheme is a function of the IP address; in alternate embodiments, the load balancing scheme is a function of the IP address and either the destination or source TCP port number. The media access control (MAC) address that represents the selected NIC is inserted in the outgoing data packet. The data packet is then sent using the selected NIC.

TECHNICAL FIELD

The present invention relates to the field of computer system networks. In particular, the present invention pertains to a software-based module for augmenting a server computer system to perform network interface card load balancing.

BACKGROUND ART

Computer systems linked to each other in a network are commonly used in businesses and other organizations. Computer system networks (“networks”) provide a number of benefits for the user, such as increased productivity, flexibility, and convenience as well as resource sharing and allocation.

Networks are configured in different ways depending on implementation-specific details such as the hardware used and the physical location of the equipment, and also depending on the particular objectives of the network. In general, networks include one or more server computer systems, each communicatively coupled to numerous client computer systems.

One common type of network configuration includes a number of virtual local area networks (VLANs). VLANs provide numerous advantages, a primary advantage being that the client computer systems associated with a particular server computer system do not need to all be in the same physical location.

In contemporary networks, server computer systems are typically coupled to the network using more than one network interface card (NIC). Multiple NICs increase the total available bandwidth capacity for transmitting and sending data packets. Multiple NICs also provide resiliency and redundancy if one of the NICs fails. In the case of a failure of a NIC, one of the other NICs is used to handle the traffic previously handled by the failed NIC, thereby increasing overall system reliability.

It is desirable to balance the traffic over each NIC when multiple NICs are used so that one NIC doesn't handle too much traffic and become a bottleneck (this is referred to as load balancing). The use of load balancing allows the spare capacity provided by the multiple NICs to be effectively utilized. It is not necessary to hold a NIC in reserve in case one of the NICs fails; instead, all NICs can be used, thereby increasing the overall performance of the server computer system and hence the network.

Prior Art FIG. 1 is an illustration of exemplary network 50 including two VLANs. In network 50, client computer system 140 (e.g., a workstation) is in one VLAN, and client computer systems 141, 142 and 143 are in a second VLAN. Both VLANs are serviced by server computer system 160. A data packet sent by server computer system 160 contains address information that is used to identify the particular client computer system(s) to which the data packet is to be sent. In addition, the data packet is tagged with a VLAN identifier that identifies the destination VLAN. The methods for addressing a data packet in a network comprising multiple VLANs are well known in the art; one method is defined by the IEEE 802.1Q standard.

Switches 150 and 151 are able to read the VLAN identifier and the other address information contained in the data packet and direct the data packet accordingly. Thus, switch 150 reads the VLAN identifier and will direct the data packet to client computer system 140 if appropriate. Otherwise, the data packet proceeds to switch 151, which directs the data packet to the proper client computer system (e.g., client computer systems 141, 142 or 143) depending on the address information contained in the data packet.

One prior art technique for load balancing utilizes a switch-dependent protocol implemented using server computer system 160 and switches 150 and 151. This prior art technique also requires NICs that are specifically designed for compatibility with switches 150 and 151 and the switch-dependent protocol. This prior art technique is problematic because it requires the use of a specific type of hardware (e.g., a specific type of NIC compatible with a specific type of switch). Thus, this prior art technique is not suitable for legacy hardware already present in a network. In addition, the cost of implementing this type of prior art technique is higher because of the need to replace or upgrade legacy devices.

Another drawback to this type of prior art technique is that the switch must be designed with the capability to implement the load balancing scheme. Thus, the complexity and the cost of the switch are substantially increased. Even so, the capabilities of the switch are relatively limited, and so the scheme for providing load balancing is also limited.

Other prior art techniques attempt to address the drawbacks identified above by implementing software-based load balancing methods implemented on a server computer system. The prior art load balancing methods used in these techniques are based on either a round-robin approach or an approach using the media access control (MAC) address that is associated with each NIC (a unique MAC address is assigned to each NIC by the vendor of the NIC).

In a round-robin approach, a first data packet is sent out using a first NIC, a second data packet with a second NIC, and so on; when all NICs have been used to send out a data packet, the sequence returns to the first NIC and the cycle is repeated. However, the round-robin approach is problematic because multiple data packets are typically associated with a given session or transaction between a server computer system and a client computer system. Thus, multiple NICs may be used for a single transaction involving multiple data packets. Consequently, the data packets for that transaction often reach the client computer system out of order. Some computer system protocols are not able to properly handle out-of-order data packets and so the data packets have to be retransmitted until they are received by the client computer system in the proper order. Thus, the round-robin approach causes a high incidence of retransmissions that increase the time needed to complete a transaction and reduce the overall performance of the computer system network.

In the MAC-based approach, the selected NIC is chosen by applying some type of procedure that aligns a NIC with a particular MAC address so that, in essence, a data packet bound for the particular MAC address is always sent out over the same NIC. While this addresses the problem of out-of-order data packets associated with the round-robin approach, the MAC-based approach introduces additional problems. For instance, all client computer systems lying across a particular router will be assigned to the same NIC because the client computer systems all contain the same MAC address (the MAC address for the router); hence, if traffic across this router is normally heavy relative to other routers, the load over the associated NIC will not be balanced relative to other NICs. In addition, the MAC-based approach is based on the distribution of MAC addresses across the client computer systems, and because the MAC addresses may not be evenly distributed (e.g., one router may serve more client computer systems than another router), the load across the NICs will not be evenly balanced. Also, the bandwidth available to the client computer system is limited by the bandwidth of the NIC that the client computer system is affiliated with by the MAC address; for example, by virtue of its MAC address, a client computer system with a one gigabit/second NIC may be affiliated with a 100 megabits/second NIC, and consequently the bandwidth of the client computer system is limited to 100 megabits/second.

Accordingly, a need exists for a system and method for load balancing wherein the system and method are not limited by the capabilities of a switch. A need also exists for a system and method that satisfy the above need, are switch-independent, and can be used with legacy hardware (e.g., legacy switches and NICs). A need further exists for a system and method that satisfy the above needs and do not cause data packets to be transmitted or received out of order and also overcome the shortcomings associated with a MAC-based approach described above.

DISCLOSURE OF THE INVENTION

The present invention provides a system and method for load balancing traffic across network interface cards (NICs) wherein the system and method are not limited by the capabilities of a switch. The present invention also provides a system and method that satisfy the above need, are switch-independent, and can be used with legacy hardware (e.g., legacy switches and NICs). Furthermore, the present invention provides a system and method that satisfy the above needs and do not cause data packets to be transmitted or received out of order and also overcome the shortcomings associated with a MAC-based approach; namely, the present invention does not assign the same NIC to all traffic across a router, balances the load more evenly across all NICs, and does not unnecessarily limit the bandwidth available to a client computer system.

Specifically, in one embodiment, the present invention pertains to a system and method implemented on a server computer system having a plurality of NICs coupled thereto, wherein the system and method are used to select a NIC for sending an outgoing data packet from the server computer system. The outgoing data packet is addressed using an Internet Protocol (IP) address and a Transmission Control Protocol (TCP) port number. A load balancing scheme is executed in order to select a NIC from the plurality of NICs. The media access control (MAC) address that represents the selected NIC is inserted in the outgoing data packet. The data packet is then sent using the selected NIC.

In one embodiment, the load balancing scheme is a function of the IP address. In that embodiment, the load balancing scheme is defined by:

SelectedNIC=IPAddress MOD NumberNICs;

wherein “SelectedNIC” is the selected NIC, “IPAddress” is the IP address of the outgoing data packet, and “NumberNICs” is the number of NICs coupled to the server computer system.

In alternate embodiments, the load balancing scheme is a function of the IP address and either the destination or source TCP port number. In these embodiments, the load balancing scheme is defined by:

SelectedNIC=(IPAddress XOR DestTCPPort) MOD NumberNICs; or

SelectedNIC=(IPAddress XOR SourceTCPPort) MOD NumberNICs; or

SelectedNIC=(IPAddress XOR SourceTCPPort XOR DestTCPPort) MOD NumberNICs;

wherein “SelectedNIC” is the selected NIC, “IPAddress” is the IP address of the outgoing data packet, “SourceTCPPort” is the TCP port number for a source port of the outgoing data packet, “DestTCPPort” is the TCP port number for a destination port of the outgoing data packet, and “NumberNICs” is the number of NICs coupled to the server computer system.

These and other objects and advantages of the present invention will become obvious to those of ordinary skill in the art after having read the following detailed description of the preferred embodiments which are illustrated in the various drawing figures.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention:

FIG. 1 is a block diagram of an exemplary computer system network of the prior art.

FIG. 2 shows a general purpose server computer system upon which embodiments of the present invention may be implemented.

FIG. 3 is a hardware and software data flow diagram of the logical components of the server computer system of FIG. 2 in accordance with one embodiment of the present invention.

FIG. 4 is a block diagram of an exemplary computer system network including the server computer system of FIG. 2 upon which embodiments of the present invention may be implemented.

FIGS. 5A and 5B are block diagrams of the software configuration of the server computer system of FIG. 2 in accordance with one embodiment of the present invention.

FIG. 6 is a flowchart of one embodiment of the process executed for an outgoing data packet in accordance with the present invention.

BEST MODE FOR CARRYING OUT THE INVENTION

Reference will now be made in detail to the preferred embodiments of the invention, examples of which are illustrated in the accompanying drawings. While the invention will be described in conjunction with the preferred embodiments, it will be understood that they are not intended to limit the invention to these embodiments. On the contrary, the invention is intended to cover alternatives, modifications and equivalents, which may be included within the spirit and scope of the invention as defined by the appended claims. Furthermore, in the following detailed description of the present invention, numerous specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be obvious to one of ordinary skill in the art that the present invention may be practiced without these specific details. In other instances, well-known methods, procedures, components, and circuits have not been described in detail so as not to unnecessarily obscure aspects of the present invention.

Some portions of the detailed descriptions which follow are presented in terms of procedures, logic blocks, processing, and other symbolic representations of operations on data bits within a computer memory. These descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. A procedure, logic block, process, etc., is here, and generally, conceived to be a self-consistent sequence of steps or instructions leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated in a computer system. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, bytes, values, elements, symbols, characters, terms, numbers, or the like.

It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as “addressing” or “executing” or “inserting” or “replacing” or “sending” or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.

The present invention pertains to a method for selecting a network interface card (NIC) to be used to send an outgoing data packet from a server computer system having a plurality of NICs coupled thereto. The outgoing data packet is addressed using an Internet Protocol (IP) address and a Transmission Control Protocol (TCP) port number. A load balancing scheme is executed in order to select a NIC from the plurality of NICs. The media access control (MAC) address that represents the selected NIC is inserted in the outgoing data packet. The data packet is then sent using the selected NIC. In one embodiment, the load balancing scheme is a function of the IP address. In alternate embodiments, the load balancing scheme is a function of the IP address and either the destination or source TCP port number.

Refer to FIG. 2 which illustrates an exemplary server computer system 190 upon which embodiments of the present invention may be practiced. Server computer system 190 is communicatively coupled to other computer systems (not shown) in a network.

In general, server computer system 190 used by the embodiments of the present invention comprises a bus 100 for communicating information, a central processor 101 coupled with bus 100 for processing information and instructions, a random access memory 102 coupled with bus 100 for storing information and instructions for central processor 101, a read-only memory 103 coupled with bus 100 for storing static information and instructions for central processor 101, a data storage device 104 such as a magnetic or optical disk and disk drive coupled with bus 100 for storing information and instructions, an optional display device 105 coupled to bus 100 for displaying information to the computer user, an optional alphanumeric input device 106 including alphanumeric and function keys coupled to bus 100 for communicating information and command selections to central processor 101, and an optional cursor control device 107 coupled to bus 100 for communicating user input information and command selections to central processor 101.

Display device 105 of FIG. 2 utilized with server computer system 190 of the present embodiment may be a liquid crystal device, cathode ray tube, or other display device suitable for creating graphic images and alphanumeric characters recognizable to the user. Cursor control device 107 allows the computer user to dynamically signal the two-dimensional movement of a visible symbol (pointer) on a display screen of display device 105. Many implementations of the cursor control device are known in the art including a trackball, mouse, joystick or special keys on alphanumeric input device 106 capable of signaling movement of a given direction or manner of displacement. It is to be appreciated that the cursor control device 107 also may be directed and/or activated via input from the keyboard using special keys and key sequence commands. Alternatively, the cursor may be directed and/or activated via input from a number of specially adapted cursor directing devices.

Continuing with reference to FIG. 2, server computer system 190 is adapted to be coupled via bus 100 to a plurality of network interface cards (NICs) exemplified by NICs 108 a, 108 b, 108 c and 108 d. NICs 108 a-d provide the physical communication link between server computer system 190 and a network of client computer systems and other server computer systems (not shown). Any of a number of different and well known types of NICs may be used to communicate with the network of client and server computer systems. It is appreciated that any number of NICs may be utilized in accordance with the present invention. It is further appreciated that NICs 108 a-d may be integrated into server computer system 190 or they may be externally coupled to server computer system 190.

FIG. 3 is a hardware and software data flow diagram of the logical components of server computer system 190 in accordance with one embodiment of the present invention. In the present embodiment, application layer 310 and network layer 320 are software elements having the functions and responsibilities defined by the well-known International Standards Organization/Open System Interconnection (ISO/OSI) reference model; however, it is appreciated that the present invention is not limited to this type of configuration or the ISO/OSI reference model. Application layer 310 and network layer 320 constitute a portion of the software elements in server computer system 190 commonly referred to as the protocol stack; it is understood that for simplicity only the relevant layers of the ISO/OSI reference model are shown in FIG. 3.

Application layer 310 defines the manner in which application programs (e.g., computer software programs, word processors, database management systems, electronic mail, and the like) interact with the communication network.

Network layer 320 contains the computer-to-computer or computer-to-network protocol that defines the procedures to be followed when data packets are transmitted and received. The protocols used by network layer 320 include, for example, IP (Internet Protocol), IPX (Intemetwork Packet Exchange), or other protocols known in the art. Network layer 320 is responsible for determining addresses or for translating hardware addresses to network addresses. In the present embodiment, network layer 320 utilizes TCP/IP (Transmission Control Protocol/Internet Protocol); thus, the address contained in an outgoing data packet also includes an IP address and a TCP port number.

Continuing with reference to FIG. 3, in the present embodiment server computer system 190 is adapted to have a plurality of NICs; for illustration purposes, only four NICs 108 a-d are shown, although it is appreciated that any number of NICs may be used in accordance with the present invention. Associated with each of NICs 108 a-d are NIC drivers 340 a-d, respectively. In the ISO/OSI reference model, NICs 108 a-d correspond to the physical layer and NIC drivers 340 a-d correspond to the data-link layer. NIC drivers 340 a-d provide an interface for the protocols of network layer 320. NIC drivers 340 a-d also provide media access control; that is, they provide access to the particular physical encoding and transport scheme used by NICs 108 a-d. As described above, NICs 108 a-d provide the physical connection to the network. Each of NICs 108 a-d has a unique media access control (MAC) address.

In the present embodiment, the present invention is a software element (e.g., load balancing scheme 335) introduced into server computer system 190 between network layer 320 and NIC drivers 340 a-d. As such, load balancing scheme 335 is positioned to intercept all data packets sent by server computer system 190, as well as all other like transactions such as requests, sets and gets. Load balancing scheme 335 is used to select one NIC out of the plurality of NICs which will be used to transmit outgoing data packets.

By integrating load balancing scheme 335 into server computer system 190, the present embodiment of the present invention takes advantage of the abundant resources (e.g., processing power and memory) available in a server computer system. In addition, because load balancing scheme 335 is incorporated entirely into server computer system 190, it is switch-independent and thus can be used with different types of switches including legacy devices. As will be seen by the discussion below, there are a number of other advantages associated with the present invention.

In one embodiment, load balancing scheme 335 is a function of the IP address. In that embodiment, the load balancing scheme is defined by the following function:

SelectedNIC=IPAddress MOD NumberNICs;

wherein “SelectedNIC” is the selected NIC, “IPAddress” is the IP address of the outgoing data packet, and “NumberNICs” is the number of NICs coupled to the server computer system. “MOD” is a known operation and is illustrated by the example below. In the present embodiment, the least significant bit of the IP address is used.

In alternate embodiments, load balancing scheme 335 is a function of the IP address and either the destination or source TCP port number. In these embodiments, the load balancing scheme is defined by one of the following functions:

SelectedNIC=(IPAddress XOR DestTCPPort) MOD NumberNICs; or

SelectedNIC=(IPAddress XOR SourceTCPPort) MOD NumberNICs; or

SelectedNIC=(IPAddress XOR SourceTCPPort XOR DestTCPPort) MOD NumberNICs;

wherein “SelectedNIC” is the selected NIC, “IPAddress” is the IP address of the outgoing data packet, “SourceTCPPort” is the TCP port number for the source port of the outgoing data packet, “DestTCPPort” is the TCP port number for the destination port of the outgoing data packet, and “NumberNICs” is the number of NICs coupled to the server computer system. “MOD” and “XOR” are known operations that are illustrated in the following example. In the present embodiment, the least significant bit of the IP address and TCP port number are used.

Following is an illustrative example of the use of the embodiment of load balancing scheme 335 defined by: SelectedNIC=(IPAddress XOR DestTCPPort) MOD NumberNICs. Network layer 320 specifies an IP address of 128.1.1.2 and a destination TCP port number of 5. In the XOR operation, the least significant bits are represented as binary numbers. The XOR operation is as follows: $\begin{matrix} {2 =} & 010 & \quad \\ {5 =} & \underset{\_}{101} & \quad \\ {XOR} & 111 & {= 7} \end{matrix}$

In the MOD operation, the result from the XOR operation is divided by the number of NICs, and the remainder is used as the means for identifying the NIC over which the outgoing data is to be transmitted as follows (in this example, four NICs are used):

Thus, in this example, the remainder of 3 is used to identify NIC number 3 as the selected NIC.

Load balancing scheme 335 as a function of the IP address alone or in combination with the TCP port number incorporates a number of advantages. First, it evenly distributes the outgoing data packets over each of the NICs because the parameters used to select the NIC in each of the embodiments of load balancing scheme 335 are equally weighted, and thus a relatively even distribution is expected. In addition, for the same IP address and TCP port number, the same NIC is selected, so that an affinity is established between a NIC and a client computer system; thus, for a transaction involving multiple outgoing data packets, each data packet will be sent out in the proper order over the same NIC and received by the client computer system in the proper order. Also, outgoing traffic to different client computer systems across the same router will be distributed across different NICs because each client computer system has a different IP address. Furthermore, for multiple transactions between a client computer system and the server computer system, a different NIC may be selected for each transaction because a different TCP port number will be associated with each transaction; this addresses those situations in which a client computer system with a one gigabit/second NIC is in communication with a server computer system having multiple 100 megabit/second NICs.

In accordance with the present invention, the load balancing function being used by load balancing scheme 335 can be dynamically switched to another load balancing function if it is determined that one of the NICs is not being used. Each of the different load balancing functions are executed until a result is achieved that names the unused NIC as the selected NIC. The load balancing function that provided the desired result then continues to be utilized until it is subsequently determined that another NIC is not being used, at which point a different load balancing function is chosen in the manner just described. Thus, the present invention incorporates a mechanism that provides additional assurance that the outgoing traffic is evenly distributed over all of the NICs.

With reference still to FIG. 3, in one embodiment, load balancing scheme 335 is implemented as one module of dynamic access software element 330. In general, dynamic access software element 330 represents a system and method for sending and receiving data packets over a network of computer systems from a server computer system having a plurality of NICs coupled thereto. Dynamic access software element 330 may incorporate features such as fault tolerance, class of service (for assigning a priority to outgoing data packets), multicast registration, and support of virtual local area networks (VLANs) compliant with IEEE standard 802.1Q. It is appreciated that the present invention load balancing scheme 335 is not limited to implementation with dynamic access software element 330.

In one embodiment, dynamic access software element 330 consists of a protocol and a media access control (MAC) driver. A virtual MAC is created by dynamic access software element 330 for each VLAN included in the computer system network. Similarly, a virtual MAC can correspond to a unique IP and subnet address. The virtual MAC address is used to represent the MAC addresses of NICs 108 a-d.

Thus, in the embodiment of the present invention in which load balancing scheme 335 is implemented using dynamic access software element 330, an outgoing data packet is addressed in network layer 320 using a first MAC address. In the present embodiment, the first MAC address is the virtual MAC address representing NICs 108 a-d. A NIC is selected from NICs 108 a-d using load balancing scheme 335. The first MAC address in the outgoing data packet is replaced with a second MAC address, wherein the second MAC address represents the selected NIC. The outgoing data packet is then transmitted using the selected NIC.

FIG. 4 is a block diagram of an exemplary network 400 comprised of server computer system 190 incorporating load balancing scheme 335 and coupled to VLAN1 410 and VLAN2 420 via switches 450 and 451. VLAN1 410 is comprised of client computer system 440, and VLAN2 420 is comprised of client computer systems 441, 442 and 443. In this embodiment, network 400 is compliant with IEEE standard 802.1Q. It is appreciated that other network configurations made up of different numbers of components may be utilized in accordance with the present invention. In accordance with the present invention, switches 450 and 451 may be any of a variety of well known switches.

FIGS. 5A and 5B represent the software configuration of server computer system 190 (FIGS. 2 and 3) for various implementations of one embodiment of the present invention. These figures indicate the direction of an outgoing data packet from server computer system 190; all requests, sets and gets also follow the paths indicated. It is appreciated that for simplicity of discussion, only two NICs and two VLANs are presented; however, any number of NICs and VLANs may be utilized in accordance with the present invention.

With reference to FIG. 5A, server computer system 190 has two NICs coupled thereto represented, respectively, by MAC1 address 471 and MAC2 address 472. The network comprises a single VLAN (e.g., VLAN1 410). With multiple NICs, load balancing scheme 335 is enabled in accordance with the present invention. In the present embodiment, load balancing scheme 335 is implemented via dynamic access software element 330.

In the present embodiment, dynamic access software element 330 creates virtual MAC address 480 corresponding to VLAN1 410. Virtual MAC address 480 is registered with the Network Driver Interface Specification (NDIS) wrapper. Accordingly, network layer 320 is bound to virtual MAC address 480, which in turn is bound to dynamic access software element 330, which in turn is bound to MAC1 address 471 and MAC2 address 472. Hence, network layer 320 is not bound directly to MAC1 address 471 and MAC2 address 472 except through virtual MAC address 480 and dynamic access software element 330.

Continuing with reference to FIG. 5A, virtual MAC 480 represents both MAC1 address 471 and MAC2 address 472 to network layer 320. That is, from the perspective of network layer 320, the NICs appear to be a single NIC with a single MAC address (the virtual MAC address). Thus, network layer 320 specifies a single MAC address (the virtual MAC address) in an outgoing data packet. Dynamic access software element 330 executes load balancing scheme 335 to select one of the NICs to be used to transmit the outgoing data packet. Dynamic access software element 330 then converts the virtual MAC address (the address specified by network layer 320) into the MAC address corresponding to the NIC that will be used to transmit the data packet. Additional details are provided below in conjunction with FIG. 6.

With reference to FIG. 5B, server computer system 190 has two NICs coupled thereto represented by MAC1 address 471 and MAC2 address 472, respectively. The network comprises two VLANs (e.g., VLAN1 410 and VLAN2 420). With multiple NICs, load balancing scheme 335 is enabled. In the present embodiment, load balancing scheme 335 is implemented via dynamic access software element 330.

In the present embodiment, dynamic access software element 330 creates virtual MAC1 address 481 and virtual MAC2 address 482 which correspond to VLAN1 410 and VLAN2 420, respectively. Virtual MAC1 address 481 and virtual MAC2 address 482 are registered with the NDIS wrapper. Accordingly, network layer 320 is bound to both virtual MAC1 address 481 and virtual MAC2 address 482, which in turn are bound to dynamic access software element 330, which in turn is bound to MAC1 address 471 and MAC2 address 472.

Continuing with reference to FIG. 5B, virtual MAC 480 represents both MAC1 address 471 and MAC2 address 472 to network layer 320. That is, from the perspective of network layer 320, the NICs appear to be a single NIC with a single MAC address (the virtual MAC address). Thus, network layer 320 specifies a single MAC address (the virtual MAC address) in an outgoing data packet. Network layer 320 also specifies the virtual MAC address corresponding to the VLAN that is the destination of the outgoing data packet. Dynamic access software element 330 executes load balancing scheme 335 to select one of the NICs to be used to transmit the outgoing data packet. Dynamic access software element 330 then converts the virtual MAC address (the address specified by network layer 320) into the MAC address corresponding to the NIC that will be used to transmit the data packet. Dynamic access software element 330 also inserts the actual VLAN identifier for the destination VLAN. Additional details are provided below in conjunction with FIG. 6.

FIG. 6 is a flowchart of one embodiment of process 600 executed by dynamic access software element 330 to implement load balancing scheme 335 for an outgoing data packet in accordance with the present invention. Process 600 includes a number of features in addition to load balancing scheme 335 that can be implemented by dynamic access software element 330; however, it is appreciated that in alternate embodiments a subset of these features may be used, and that in other embodiments other features (e.g., snap-ins) not described herein may be implemented.

In step 605, dynamic access software element 330 receives a data packet from network layer 320. The outgoing data packet contains the MAC address specified by network layer 320; as described above, network layer 320 is bound to dynamic access software element 330 so the address specified by network layer 320 is actually the virtual MAC address (e.g., virtual MAC1 address 481 of FIG. 5B). The operations performed by dynamic access software element 330 are transparent to network layer 320, and therefore in effect network layer 320 believes it is addressing the outgoing data packet in a normal fashion.

In this embodiment, network layer 320 utilizes TCP/IP (Transmission Control Protocol/Internet Protocol); thus, the address contained in outgoing data packet also includes an IP address and a TCP port number. Dynamic access software element 330 classifies the outgoing data packet according to the protocol being used; in this embodiment, the protocol used is TCP/IP and so in this step dynamic access software element 330 indicates the pointers to all of the relevant TCP/IP headers.

In step 610, a class of service snap-in module can be used to prioritize the outgoing data packet according to the class of service specified by the user or network administrator. The outgoing data packet is placed in a queue according to its priority or is sent immediately through the remaining steps of process 600. Various class of service schemes can be implemented in accordance with the present invention.

In step 615, a snap-in module can be used to incorporate protocols being implemented by server computer system 190 (FIGS. 2 and 3). These protocols include Fast IP (FIP), generic attributes registration protocol (GARP) multicast registration protocol (GMRP), and GARP VLAN registration protocol (GVRP). Various protocols can be implemented in accordance with the present invention.

In step 620, a VLAN tag is inserted into the header of the outgoing data packet. The tag corresponds to the protocol header identified in step 605.

In step 625, the trunk director identifies the load balancing scheme utilized in step 630 (e.g., load balancing scheme 335 of FIG. 3).

In step 630, load balancing scheme 335 utilized by dynamic access software element 330 is executed. The various embodiments of load balancing scheme 335 are described above in conjunction with FIG. 3. Load balancing scheme 335 identifies the NIC to be used to transmit the outgoing data packet. If a NIC is not being used, and the embodiment of load balancing scheme 335 being used does not result in the unused NIC being selected to transmit the outgoing data packet, then a different embodiment is executed until the result identifies the unused NIC as the selected NIC.

In step 635, the fault tolerance module utilized by dynamic access software element 330 is employed. In the present embodiment, the fault tolerance module is a snap-in module and therefore different schemes can be incorporated. The fault tolerance scheme is used to determine whether the NIC selected in step 630 is functioning. The fault tolerance module monitors the NICs and maintains a list of MAC addresses for NICs that are active. The fault tolerance module dynamically adds and removes MAC addresses from the list depending on the status of each NIC. When the selected NIC is found to be disabled (e.g., it is not on the list), a different NIC is substituted from the list. It is appreciated that the fault tolerance module does not have to be in the data stream but can perform its function in the background. The fault tolerance scheme can be utilized without load balancing.

In step 640, the true MAC address corresponding to the NIC selected in steps 630 and 635 (e.g., MAC1 address 471 of FIG. 5B) is inserted into the outgoing data packet in place of the virtual MAC address initially specified by network layer 320.

In step 645, the identifier for the destination VLAN is added to the address of the outgoing data packet per IEEE standard 802.1Q. If only one VLAN is present in the network, then the outgoing data packet passes through this step without modification.

In step 650, the outgoing data packet is forwarded to the selected NIC (see steps 630 and 635), then transmitted out to and over the network.

In summary, in one embodiment the present invention provides a method and system for load balancing wherein the method and system are contained in and implemented by a server computer system. The present invention can be used with multiple NICs in a multiple VLAN environment. The present embodiment of the present invention is designed as a software element that is inserted between the protocol stack (e.g., the network layer) in the server computer system and the NIC drivers. In one embodiment, the present invention is implemented using a dynamic access software element that provides other features and snap-ins such as fault tolerance.

The present invention is independent of the types of switches, routers, or other hardware used in the computer system network. Legacy devices and software can therefore be used with the present invention. The software solution provided by the present embodiment of the present invention minimizes costs because it is integrated at the software level and hardware modifications and upgrades are not necessary.

Furthermore, the present invention provides a system and method that do not cause data packets to be transmitted or received out of order. In addition, the present invention does not assign the same NIC to all traffic across a router, balances the load more evenly across all NICs, and does not unnecessarily limit the bandwidth available to a client computer system.

The preferred embodiment of the present invention, high performance load balancing of outbound IP traffic over multiple NICs, is thus described. While the present invention has been described in particular embodiments, it should be appreciated that the present invention should not be construed as limited by such embodiments, but rather construed according to the following claims. 

What is claimed is:
 1. In a server computer system adapted to have a plurality of network interface cards (NICs) coupled thereto, a method for selecting a NIC for sending an outgoing data packet, said method comprising the computer-implemented steps of: a) addressing said outgoing data packet using an Internet Protocol (IP) address, a Transmission Control Protocol (TCP) port number, and a virtual media access control (MAC) address, said virtual MAC address representing said plurality of NICs; b) executing a load balancing scheme to specify a selected NIC from said plurality of NICs, wherein said load balancing scheme is a function of said IP address; c) replacing said virtual MAC address in said outgoing data packet with a MAC address representing said selected NIC; and d) sending said outgoing data packet using said selected NIC.
 2. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 further comprising the steps of: e) verifying functionality of said selected NIC using a fault tolerance scheme; and f) automatically switching from said selected NIC to a different NIC when said fault tolerance scheme indicates said selected NIC is not available.
 3. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 wherein said step b) further comprises: selecting said load balancing scheme from a plurality of load balancing schemes.
 4. The method for selecting a NIC for sending an outgoing data packet as recited in claim 3 wherein said step b) further comprises: dynamically switching from a first load balancing scheme to a second load balancing scheme when one of said plurality of NICs is not being used.
 5. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (DestTCPPort)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 6. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR ((SourceTCPPort) XOR (DestTCPPort))) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a source port, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 7. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (SourceTCPPort)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 8. The method for selecting a NIC for sending an outgoing data packet as recited in claim 1 wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=(IPAddress) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, and NumberNICs is the number of said plurality of NICs.
 9. A server-side computer system comprising: a bus; a processor coupled to said bus; and a computer-readable memory unit coupled to said bus; said computer system adapted to have a plurality of network interface cards (NICs) coupled thereto; said processor for performing a method for selecting a NIC for sending an outgoing data packet, said method comprising the steps of: a) addressing said outgoing data packet using an Internet Protocol (IP) address and a Transmission Control Protocol (TCP) port number; b) executing a load balancing scheme to specify a selected NIC from said plurality of NICs, wherein said load balancing scheme is a function of said IP address and wherein said load balancing scheme is selected from a plurality of load balancing schemes and wherein said load balancing scheme is changed from a first load balancing scheme to a second load balancing scheme when one of said plurality of NICs is not being used; c) inserting a media access control (MAC) address in said outgoing data packet, wherein said MAC address represents said selected NIC; and d) sending said outgoing data packet using said selected NIC.
 10. The computer system of claim 9 wherein said processor performs said method for selecting a NIC for sending an outgoing data packet further comprising the steps of: e) verifying functionality of said selected NIC using a fault tolerance scheme; and f) automatically switching from said selected NIC to a different NIC when said fault tolerance scheme indicates said selected NIC is not available.
 11. The computer system of claim 9 wherein said processor performs said method for sending an outgoing data packet wherein said step a) further comprises: addressing said outgoing data packet using a virtual MAC address representing said plurality of NICs; and wherein said step c) further comprises: replacing said virtual MAC address with said MAC address of said selected NIC.
 12. The computer system of claim 9 wherein said processor performs said method for sending an outgoing data packet wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (DestTCPPort)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 13. The computer system of claim 9 wherein said processor performs said method for sending an outgoing data packet wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR ((SourceTCPPort) XOR (DestTCPPort))) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a source port, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 14. The computer system of claim 9 wherein said processor performs said method for sending an outgoing data packet wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (SourceTCPPort)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 15. The computer system of claim 9 wherein said processor performs said method for sending an outgoing data packet wherein said step b) comprises executing said load balancing scheme defined as: SelectedNIC=(IPAddress) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, and NumberNICs is the number of said plurality of NICs.
 16. A computer-usable medium having computer readable program code embodied therein for causing a server-side computer system adapted to have a plurality of network interface cards (NICs) coupled thereto to perform the steps of: a) addressing said outgoing data packet using an Internet Protocol (IP) address and a Transmission Control Protocol (TCP) port number; b) executing a load balancing scheme to specify a selected NIC from said plurality of NICs, wherein said load balancing scheme is a function of said IP address and said TCP port number and wherein said load balancing scheme comprises an XOR operation of the least significant bit of said IP address and the least significant bit of said TCP port number; c) inserting a media access control (MAC) address in said outgoing data packet, wherein said MAC address represents said selected NIC; and d) sending said outgoing data packet using said selected NIC.
 17. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to perform the steps of: e) verifying functionality of said selected NIC using a fault tolerance scheme; and f) automatically switching from said selected NIC to a different NIC when said fault tolerance scheme indicates said selected NIC is not available.
 18. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to perform the steps of: addressing said outgoing data packet using a virtual MAC address representing said plurality of NICs; and replacing said virtual MAC address with said MAC address of said selected NIC.
 19. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to perform the step of: selecting said load balancing scheme from a plurality of load balancing schemes.
 20. The computer-usable medium of claim 19 wherein said computer-readable program code embodied therein causes a server-side computer system to perform the step of: dynamically switching from a first load balancing scheme to a second load balancing scheme when one of said plurality of NICs is not being used.
 21. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to execute said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (DestTCPPort)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 22. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to execute said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR ((SourceTCPPort) XOR (DestTCPPort))) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a source port, DestTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs.
 23. The computer-usable medium of claim 16 wherein said computer-readable program code embodied therein causes a server-side computer system to execute said load balancing scheme defined as: SelectedNIC=((IPAddress) XOR (SourceTCPPbrt)) MOD (NumberNICs); wherein SelectedNIC is said selected NIC, IPAddress is said IP address, SourceTCPPort is said TCP port number for a destination port, and NumberNICs is the number of said plurality of NICs. 